#include <ddt.h>
#include <stdio.h>
#include <unistd.h>

int main() {

	dd_w = 50;
	dd_h = 50;

	dd_create_context();

	struct dd_triangle tri;

	tri.v1.x = 0;
	tri.v1.y = 0;
	tri.v1.z = 1;

	tri.v2.x = -5;
	tri.v2.y = -5;
	tri.v2.z = 1;

	tri.v3.x = 5;
	tri.v3.y = -5;
	tri.v3.z = 1;

	tri.color = 8;

	while (1) {
		
		dd_buffer_clear();

		dd_matrix_rotate_z(dd_global_matrix, 0.1f);

		dd_triangle_draw(tri);

		printf("\E[H\E[2J");
		dd_buffer_draw();

		usleep(25000);
	}

	return 0;
}
